<template>
  <div class="scroll-top" @click="returnTop">
    <div class="box-in"></div>
  </div>
</template>
<script>
  export default {
    name: 'scroll-top',
    methods: {
      returnTop() {
        document.documentElement.scrollTop = document.body.scrollTop = 0;
      }
    }
  }
</script>

<style scoped>
  .scroll-top {
    position: fixed;
    width: 50px;
    height: 30px;
    right: 10px;
    bottom: 150px;
    padding-top: 20px;
    text-align: center;
    background-color: papayawhip;
    border-radius: 20%;
    overflow: hidden;
    box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.2);

  }

  .box-in {
    visibility: visible;
    display: inline-block;
    height: 15px;
    width: 15px;
    border: 1px solid black;
    border-color: black transparent transparent black;
    transform: rotate(45deg);
  }
</style>
